package com.system.demo.controller;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.system.demo.dto.MemberDTO;
import com.system.demo.model.Member;
import com.system.demo.service.IMemberService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/member")
@Api(tags = "会员管理模块")
public class MemberController {
	
	@Resource
	private IMemberService memberService;
	
	@ApiOperation(value = "条件查询",notes = "根据条件查询会员")
	@PostMapping("/findAll")
	public Map findAll(MemberDTO dto) {
		return memberService.findAll(dto);
	}
	
	@ApiOperation(value = "保存会员",notes = "添加会员、修改信息、重置状态、逻辑删除")
	@PostMapping("/save")
	public String save(Member m) {
		memberService.save(m);
		return "success";
	}
	
}
